package exo1;

import exo1.exeption.EmptyException;
import exo1.exeption.FullException;

public class PileTransformations extends GenericPile<Point> {
	
	public PileTransformations() {
		super();
	}

	public int getTransformationCourant() {
		return index;
	}
	public void empiler(Point point){
		//Tester si il existe déja d'autres transformations
		Point tc=new Point();
			if(isEmpty()){
				tc=new Point();
			}else{
				try {
					tc=peekSafe();
				} catch (EmptyException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
			point=point.additioner(tc);
			try {
				pushSafe(point);
			} catch (FullException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
	}
	public Point depiler(){
		if(isEmpty())
			return null;
		try {
			return popSafe();
		} catch (EmptyException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}
	
}
